cmake_minimum_required(VERSION 3.20)

set(path "./README.md")
# -- 相对路径 -> 绝对路径
file(REAL_PATH ${path} path)
message(STATUS ${path})

# -- 文件全名
cmake_path(GET path FILENAME filename)
message(STATUS ${filename})

# -- 文件名不带类型后缀
cmake_path(GET path STEM stem)
message(STATUS ${stem})

# -- 文件后缀
cmake_path(GET path EXTENSION extension)
message(STATUS ${extension})